package DataStructures.mySort;

/**
 * @Author: yqy
 * @Date: 2022/06/08/11:21
 * @Description:
 */
public class Insert {
    public static int[] insert(int[] arr){
        for (int i = 1; i < arr.length; i++) {
            int val= arr[i];
            int j=i-1;
            while(j>=0 && val<arr[j]){
                arr[j+1]=arr[j];
                j--;
            }
            arr[j+1]=val;
        }
        return arr;
    }
}
